package com.apes.autoparts.parts.model;

import com.apes.framework.jpa.BaseModel;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by lishikun on 2020/12/2 11:23
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = AutopartsLog.CONST_TABLE_NAME)
public class AutopartsLog extends BaseModel {
    public static final String CONST_TABLE_NAME = "autoparts_log";

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Comment("唯一码")
    Integer id;

    @Column(name="name")
    @Comment("方法名")
    String name;

    @Column(name="request" ,length = 4000)
    @Comment("请求内容")
    String request;

    @Column(name="response", columnDefinition = "CLOB")
    @Comment("返回内容")
    String response;

    @Column(name="post_id")
    @Comment("门店编码")
    String postId;

    @Column(name="post_name")
    @Comment("门店名称")
    String postName;

    @Column(name="begin_time")
    @Comment("开始时间")
    private Date beginTime;

    @Column(name="end_time")
    @Comment("结束时间")
    private Date endTime;

    @Column(name="time")
    @Comment("耗时(毫秒)")
    private long time; //耗时(毫秒)

    private Boolean aBoolean;

}
